#include "../Model/ssm.h"
#include <stdio.h>

int main()
{
	Car car,car1;

	car.A=10.1;
	car.C_d=12;
	car.C_rr=2.5;
	car.W=6.7;
	car.M=9.008;
	car.B_C=12.32;
	car.B_CRate=-1.2;
	car.B_CPeukert=0.1;
	car.B_n=12;
	car.P_arrayMax=1.243;
	car.M_d=213.32;
	car.M_r=8.3;
	car.P_p=7;
	//set random values

	writeCar("testCar.dat",&car);
	
	readCar("testCar.dat",&car1);

	if(car1.A != car.A 
		|| car.C_d !=car1.C_d 
		|| car.W!=car1.W 
		|| car.M != car1.M 
		|| car.B_C != car1.B_C
		|| car.B_CRate != car1.B_CRate
		|| car.B_CPeukert != car1.B_CPeukert
		|| car.B_n!=car1.B_n
		|| car.P_arrayMax != car1.P_arrayMax
		|| car.M_d != car1.M_d
		|| car.M_r != car1.M_r
		|| car.P_p != car1.P_p)
	{
		fprintf(stderr,"ERROR: Car != Car1\n");
		return -1;
	}
	return 0;
}
